import ajax from '@/uni_modules/u-ajax'

// #ifdef H5
export const baseURL = window._baseURL
// #endif 

// #ifdef MP-WEIXIN		
// export const baseURL = 'http://81.68.123.86:9000' 
export const baseURL = 'https://aisi.vislan.com' 
// #endif 



// 创建请求实例
const instance = ajax.create({
	baseURL: baseURL + '/api'
})

// 添加请求拦截器
instance.interceptors.request.use(
	config => {
		return config
	},
	error => {
		return Promise.reject(error)
	}
)

// 添加响应拦截器
instance.interceptors.response.use(
	response => {
		return response.data
	},
	error => {
		return Promise.reject(error)
	}
)


export default instance